//
//  WYFItemView.m
//  跨界收
//
//  Created by Allen on 2018/10/27.
//  Copyright © 2018年 gztx. All rights reserved.
//

#import "WYFItemView.h"


@implementation WYFItemView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self){
        [self createTitleLabel];
        [self createIconImageView];
    }
    return self;
}
-(void)createIconImageView
{
    self.iconButton = [[UIButton alloc] init];
    self.iconButton.frame = CGRectMake(0, 10.0, self.width, 30);//固定
    self.iconButton.userInteractionEnabled = NO;
    [self addSubview:self.iconButton];
}
-(void)createTitleLabel
{
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.frame = CGRectMake(0, 50, self.width, 20);//固定
    self.titleLabel.font = [UIFont systemFontOfSize:16.0];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLabel];
}
- (void)setIconImageViewImage:(NSString *)icon title:(NSString *)title
{
    [self.iconButton setImage:[UIImage imageNamed:icon] forState:UIControlStateNormal];
    self.titleLabel.text = title;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
